/* eslint-disable no-shadow */
export function count({ search }) {
  return RSocket.rr({
    route: 'biz.coupon.customer.bags.count',
    args: { search },
  });
}

export function search({ search, pg }) {
  return RSocket.rs({
    route: 'biz.coupon.customer.bags',
    args: { search, pg },
  });
}

export function superAddition(id, quantity) {
  return RSocket.rr({
    route: `biz.coupon.customer.bags.${id}.append`,
    args: { ...quantity },
  });
}

/**
 * 获取卡券批次
 * @param {*} id
 * @param {*} quantity
 * @returns
 */
export function getCouponBatches(args) {
  return RSocket.rs({
    route: 'biz.coupon.batches',
    args: {
      search: { ...args },
      pg: { page: 0, size: 99 },
    },
  });
}
